//
//(C) Copyright 2011 HongKong Airline.,Ltd. 
//
/**
 * commentAction
 * 项目名称:代购系统
 * @author Mengxiangliang
 * 功能描述:
 * 历史版本:2013-01-04 v1.0.0 Mengxiangliang  创建:
 * @version [V1] 
 */
package com.gamutsoft.amb.comment.action;

import java.util.List;
import java.util.Map;

import com.gamutsoft.amb.base.action.BaseAction;
import com.gamutsoft.amb.comment.model.Comment;
import com.gamutsoft.amb.comment.service.ICommentService;
import com.gamutsoft.amb.common.bean.QueryExample;
import com.gamutsoft.amb.common.exception.BusinessException;
import com.gamutsoft.amb.common.util.ConditionUtil;
import com.gamutsoft.amb.common.util.PageUtil;


@SuppressWarnings({"serial","rawtypes"})
public class CommentAction extends BaseAction {
	
	private Comment comment;
	
	private List<Map> commentList;
	
	private ICommentService commentService;
	
	private PageUtil pageUtil;

	/**
	 * 初始化查询Comment信息
	 * @author Mengxiangliang
	 * @return
	 */
	public String searchComment()throws BusinessException, Exception {
		try {
		    QueryExample qe =ConditionUtil.copyConditionBySql(this.getRequest());
		    pageUtil =new PageUtil(this.getRequest());
		    pageUtil.setPageSize(PageUtil.PAGESIZE);
			qe.setPageUtil(pageUtil);
			commentList = commentService.searchCommentByWhere(qe, comment);
		}catch(Exception e){
			log.error(e);
			throw e;
		}
		return "search_comment_success";
	}
	
	

	/**
	 * @return the comment
	 */
	public Comment getComment() {
		return comment;
	}

	/**
	 * @param comment the comment to set
	 */
	public void setComment(Comment comment) {
		this.comment = comment;
	}

	/**
	 * @return the commentList
	 */
	public List<Map> getCommentList() {
		return commentList;
	}

	/**
	 * @param commentList the commentList to set
	 */
	public void setCommentList(List<Map> commentList) {
		this.commentList = commentList;
	}

	/**
	 * @param commentService the commentService to set
	 */
	public void setCommentService(ICommentService commentService) {
		this.commentService = commentService;
	}



	public PageUtil getPageUtil() {
		return pageUtil;
	}



	public void setPageUtil(PageUtil pageUtil) {
		this.pageUtil = pageUtil;
	}
	
}
